<?php
/**
 * Created by PhpStorm.
 * User: 异步加载
 * Date: 2017/12/28
 * Time: 21:48
 */

namespace app\api\model;


class Advertising extends BaseModel
{
    /**
     * @return false|static[]
     * 获取所有广告items关联模型
     */
    public function getAditems(){
        return $this->hasOne('Addetail','adid','id');
    }

    /**
     * @param $id
     * @return array|false|\PDOStatement|string|\think\Model
     * 根据id获取广告详情
     */
    public static function getDetail($id){
        $detail = self::with('getAditems')->find($id);
        return $detail;
    }
}